sign — sign of the argument


\begin{rail}
Sign : 'sign' '(' ( Scalar \vert Matrix ) ')' ;
\end{rail}
sign returns the sign of the argument. If the argument is greater than zero, it returns 1. If the argument is less than zero, it returns -1. Otherwise zero is returned. If the argument is a matrix, the operation is performed element-by-element, returning a matrix of the same dimensions as the argument. If the argument is complex, then sign returns the argument divided by its magnitude. $\Longrightarrow$ This is not an built-in function. This function is normally loaded on start-up from the sign.r file in the standard rlib directory. Use of the -r option, incorrectly setting the RLAB_LIB_DIR environmental variable, or modifying sign.r may make this function unavailable.

Subsections